package com.demo.designmode.reponseibility;

/**
 * @Author: jxm
 * @Description: 责任链模式 测试
 * @Date: 2023-12-11 15:28
 * @Version: 1.0
 */
public class Client {
    public static void main(String[] args) {
        //请假条来一张
        LeaveRequest leave = new LeaveRequest("小明",8,"身体不适");
        //创建各位领导
        GroupLeader groupLeader = new GroupLeader();
        Manager manager = new Manager();
        GeneralManager generalManager = new GeneralManager();

        groupLeader.setNextHandler(manager);//小组长的领导是部门经理
        manager.setNextHandler(generalManager);//部门经理的领导是总经理

        //提交申请
        groupLeader.submit(leave);
    }
}
